-
Notifications
You must be signed in to change notification settings - Fork 282
Adding MCP capability in DAB #2868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…a-api-builder into jerry-mcp-core" This reverts commit 0b649dbbc877a8ad009ac31eb4a082664d49bce3, reversing changes made to 2240172.
## Why make this change? - Introduces a dedicated runtime layer for MCP ## What is this change? - Adds a runtime initialization module that centralizes configuration load, validation, DI registration, and service/materialization order. - Refactors existing startup code into clearer phases; removes duplicated wiring. - Improves logging structure and prepares for future feature flags / layered config overrides. - Cleans up deprecated code paths (overall net +901 / −130 LOC). - No intentional breaking changes (verify before merge). ## How was this tested? - [ ] Integration Tests - [ ] Unit Tests ## Sample Request(s) - Discover tools: POST `http://localhost:5000/mcp` JSON body ``` { "jsonrpc": "2.0", "id": "1", "method": "tools/list", "params": {} } ``` - List entities: POST `http://localhost:5000/mcp` JSON body ``` { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "list_entities" } } ``` --------- Co-authored-by: Rahul Nishant <[email protected]> Co-authored-by: RubenCerna2079 <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Aniruddh Munde <[email protected]>
/azp run |
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
/azp run |
Azure Pipelines successfully started running 6 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates Model Context Protocol (MCP) capability into the Data API Builder (DAB), enabling AI/agent tooling to introspect the configured data model and perform structured operations against DAB-managed data sources.
- Adds a new MCP service layer that exposes schema/entity metadata and operation capabilities
- Introduces MCP runtime configuration options with DML tools support
- Provides endpoint mapping at
/mcp
path for MCP client interactions
Reviewed Changes
Copilot reviewed 108 out of 110 changed files in this pull request and generated 10 comments.
Show a summary per file
File | Description |
---|---|
src/Service/Startup.cs | Registers MCP services and maps MCP endpoint |
src/Config/ObjectModel/McpRuntimeOptions.cs | Defines MCP configuration structure |
src/Config/ObjectModel/DmlToolsConfig.cs | Configures DML tool availability |
src/Azure.DataApiBuilder.Mcp/ | New MCP implementation with built-in tools |
src/Core/Configurations/RuntimeConfigValidator.cs | Validates MCP configuration and path conflicts |
Multiple test files | Updates test configurations to include MCP options |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
/azp run |
Azure Pipelines successfully started running 6 pipeline(s). |
Right now we are not adding this test since we still have not been able to understand the structure of the payload that needs to be passed to the mcp which is causing the test to fail. |
/azp run |
Azure Pipelines successfully started running 6 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
/azp run |
Azure Pipelines successfully started running 6 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 6 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 6 pipeline(s). |
Why make this change?
What is this change?
Introduces an MCP service layer that exposes:
Schema / entity metadata derived from the existing DAB configuration (tables, stored procedures, relationships, GraphQL entity projections).
Operation capabilities (read / create / update / delete) aligned with DAB authorization rules.
A capability negotiation / handshake endpoint so MCP clients can discover features.
MCP endpoint can be accessed with
/mcp
Sample request to discover tools-
How was this tested?
The working of the MCP endpoint and the describe-entities tool is tested manually in the local environment.
Enable MCP in dab-config.json
"mcp": { "enabled": true, "path": "/mcp", "dml-tools": { "describe-entities": true } }
The server was started locally and confirmed to be listening on
http://localhost:5000
.Send a POST request to the MCP endpoint,
http://localhost:5000/mcp
Use the Sample Requests shared for the body of the request.
The tools/list request successfully returned all registered tools, confirming that the MCP server and tool registry were initialized correctly.
The tools/call request for describe-entities returned the expected entity metadata.
Sample Request(s)
Listing all tools available.
{ "jsonrpc": "2.0", "id": "1", "method": "tools/list", "params": {} }
Use the describe-entities tool
{ "jsonrpc": "2.0", "id": "1", "method": "tools/call", "params": { "name": "describe-entities" } }